package com.ynny.bean07;

public class Student extends People {
    public int no;
    public double scoreEn;
    public double scoreMath;

    public double scoreCh;
    public int getNo() {
        return no;
    }
    public void setNo(int no) {
        this.no = no;
    }
    public double getScoreEn() {
        return scoreEn;
    }
    public void setScoreEn(double scoreEn) {
        this.scoreEn = scoreEn;
    }
    public double getScoreMath() {
        return scoreMath;
    }
    public void setScoreMath(double scoreMath) {
        this.scoreMath = scoreMath;
    }
    public double getScoreCh() {
        return scoreCh;
    }

    public void setScoreCh(double scoreCh) {
        this.scoreCh = scoreCh;
    }
    public Student(){
        super();
    }
    public double aver(){
        double b = (scoreEn+scoreMath+scoreCh)/3;
        return b;
    }
    public double max(){
        double m1 = Math.max(Math.max(scoreCh,scoreEn),scoreMath);
        return m1;
    }
    public double  min(){
        double m2 = Math.min(Math.min(scoreCh,scoreEn),scoreMath);
        return m2;
    }
    @Override
    public String toString() {
        Student student = new Student();
        student.aver();
        student.max();
        student.min();
        return "Student{" +
                "no=" + no +
                ", scoreEn=" + scoreEn +
                ", scoreMath=" + scoreMath +
                ", scoreCh=" + scoreCh +
                ", aver=" + aver() +
                ", max=" + max() +
                ", min=" + min() +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }

}

